/*
 * @Author: Li Zengkun
 * @Date: 2022-09-12 19:34:51
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-09-18 17:07:44
 * @Description: role api
 */
import axios from 'axios'

// 为角色配置菜单
const setMenu = (data) => axios.post('/role/menu', data)

// 删除角色
const remove = (id, params) => axios.delete(`/role/${id}`, { params })

// 更新角色
const edit = (id, data) => axios.put(`/role/${id}`, data)

// 根据角色获取侧边栏菜单
const getMenu = (params) => axios.get('/role/menu/', { params })

// 添加角色
const add = (data) => axios.post('/role', data)

// 获取角色列表
const getList = (params) => axios.get('/role/list', { params })

export default {
    setMenu,
    remove,
    edit,
    getMenu,
    add,
    getList
}